import React from 'react'
import style from '../../css/MovieItem.scss'
import { Rate } from 'antd';

export default class MovieItem extends React.Component{
  constructor(props){
    super(props)
    this.state = {}
  }
  render(){
    return <div className={style.box}  onClick={this.goDetail}>
      <div className={style.img}>
        <img src={this.props.images.small} alt="封面图片"/>
      </div>
      <h5>名称：<span>{this.props.title}</span></h5>
      <h5>上映年份：<span>{this.props.mainland_pubdate}</span></h5>
      <h5>电影类型：<span>{this.props.genres[0]}</span></h5>
      <Rate allowHalf defaultValue={this.props.rating.average/2} />
    </div>
  }
  
  goDetail = ()=>{
    this.props.history.push('/movie/detail/'+this.props.id)
  }
}
